﻿package core.net.socket.cmd {
	
	import core.net.socket.SocketCmd;
	import com.adobe.serialization.json.JSON;
	public class LoggerCmd implements SocketCmd{
		
		public var level:String;
		public var content:String;
		
		public static var COMMAND_ID:String = "CMD_LOG";
		
		public function LoggerCmd() {
			
		}
		
		
		public static function make(level:String,content:String):LoggerCmd{
			var cmd:LoggerCmd = new LoggerCmd();
			cmd.level = level;
			cmd.content = content;
			return cmd;
		}
		
		public function commandString():String{
			var obj = {
				cmd:LoggerCmd.COMMAND_ID,
				level:this.level,
				content:this.content
			};
			var str:String = com.adobe.serialization.json.JSON.encode(obj);
			return str;
		}
		
	}
	
}
